﻿using Beaker;

namespace OpenCube.Nbt.Mapping.Converters
{
	/// <summary>
	/// Special converter that does not really convert, but maps model and NBT type one-one
	/// </summary>
	/// <typeparam name="TType">The type of both the Model and the NBT type.</typeparam>
	internal sealed class PassthroughConverter<TType>
		: NbtSimpleTypeConverter<TType, TType>
	{
		protected override TType ConvertToModelValue(TType nbtValue)
		{
			return nbtValue;
		}

		protected override Maybe<TType> ConvertToNbtValue(TType modelValue)
		{
			return modelValue;
		}
	}
}